<?php
	$userGroup = $comment["User"]["group_id"];
	
	if($userGroup == 1) { 
		$name = $comment["User"]["DesignerProfile"]["first_name"] . " " . $comment["User"]["DesignerProfile"]["insertion"] . " " . $comment["User"]["DesignerProfile"]["last_name"];
		if (isset($comment["User"]["DesignerProfile"]["avatar"])){
			$avatar = $comment["User"]["DesignerProfile"]["avatar"];
			}else{
				$avatar = "default_avatar.png";
			}
		}else{
			$name = $comment["User"]["ContractorProfile"]["first_name"] . " " . $comment["User"]["ContractorProfile"]["insertion"] . " " . $comment["User"]["ContractorProfile"]["last_name"];
		if (isset($comment["User"]["ContractorProfile"]["avatar"])){
			$avatar = $comment["User"]["ContractorProfile"]["avatar"];
			}else{
				$avatar = "default_avatar.png";
			}
		}
?>
<div class="clear"></div>
	<div onclick="location.href='<?php echo $this->Html->url(array('controller' => 'designs', 'action' => 'view',$comment['Design']['id'])); ?>';" style="cursor: pointer;">
	<div class="brief-detail">
		<div class="logo-conttr">
			<div class="design-kader1">	
				<img src="img/new_reaction3.png" alt="#"/>
			</div>
		</div>
							
		<div class="briefing-details">
		
			<h1>
				<?php 
					if ($userGroup == 1 ) { 
					echo $this->Html->link(Sanitize::html($name), array('controller' => 'designs', 'action' => 'view',$comment['Design']['id'])) . ' zegt..'; } else {
					echo $this->Html->link(Sanitize::html($name), array('controller' => 'designs', 'action' => 'view',$comment['Design']['id'])) . ' zegt..';
					}
				?>
			</h1>
			
			<div class="comment-body">
			<?php echo $this->FixText->fix_text(Sanitize::html($comment['Comment']['body']), 25, TRUE); ?>
			</div>
			
			<div class="comment-details">
			<p class="grey">
			<?php 
			echo $comment['Design']['name']. ', '; 
			echo $this->FixDate->fix_date(Sanitize::html($comment['Comment']['modified']), "time"); 
			?>
			</p>
			</div>

		</div>
	</div>
	<div class="clear"></div>
	</div>
	<hr />
